package com.ws.sta.controller;


import com.ws.commonutils.R;
import com.ws.sta.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author ws
 * @since 2024-12-14
 */
@RestController
@RequestMapping("/sta/statisticsdaily")
@CrossOrigin
public class StatisticsDailyController {
    @Autowired
    private StatisticsDailyService statisticsDailyService;

    @GetMapping("createSta/{day}")
    public R createSta(@PathVariable String day) {
        statisticsDailyService.createSta(day);
        return R.ok();
    }

    @PostMapping("getStaCnt/{type}/{start}/{end}")
    public R getStaCnt(@PathVariable String type, @PathVariable String start, @PathVariable String end) {
        Map<String, Object> map=statisticsDailyService.getStaCnt(type,start,end);
        return R.ok().data(map);
    }


}

